#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include <stdlib.h>


int main()
{
    char ch, most;
    int arr[26] = { 0 },a=0, n = 1;
        while ((ch = getchar()) != '\n')
            arr[ch - 97]++;
    for (n = 1; n <= 25; n++)
    {
        if (arr[n] > arr[a])
            a = n;
    }
    most = 97 + a;
    printf("%c\n%d", most, arr[a]);
  

    return 0;
}